<template>
	<view class="session">
		<scroll-view scroll-y="true" v-if="true" class="session_list">
			<Item v-for="item in item" :key="item" :item="item" />
		</scroll-view>
		<Empty v-else/>
		<Tabbar :current="1"/>
	</view>
	<!-- 添加按钮 -->
	<sessionRightAdd v-model:show="showAdd"/>
</template>

<script setup>
	import Tabbar from '@/components/tabbar/tabbar.vue';
	import { onNavigationBarButtonTap } from "@dcloudio/uni-app";
	import Empty from '@/components/common/empty.vue';
	import Item from '@/components/session/item.vue'
	import sessionRightAdd from '@/components/session/session_right_add.vue';
	import bottomInfoStore from "@/store/bottomInfo.js"
	import {ref,reactive} from 'vue';
	const showAdd = ref(false)
	const bottomInfostorge = bottomInfoStore()

	const item = ref([
		{
			id:"123456",//id
			avatar:"../../static/imgs/chatbg.png",
			username:"融合",// 名称
			date:"昨天",//时间
			desc:"描述",//描述
		},
		{
			id:"1231253",//id
			avatar:"../../static/imgs/chatbg.png",
			username:"未来",// 名称
			date:"123123",//时间
			desc:"描述",//描述
		},
		{
			id:"123123",//id
			avatar:"../../static/imgs/chatbg.png",
			username:"xx名称",
			date:"1231233",//时间
			desc:"描述",//描述
		},
		{
			id:"1231232",//id
			avatar:"../../static/imgs/chatbg.png",
			username:"融合",// 名称
			date:"123123",//时间
			desc:"描述",//描述
		},
		{
			id:"12313",//id
			avatar:"../../static/imgs/chatbg.png",
			username:"融合",// 名称
			date:"123123",//时间
			desc:"描述",//描述
		}
	])
	
	onNavigationBarButtonTap((e)=>{
		if(e.index==0){
			showAdd.value = !showAdd.value
		}
	})
</script>

<style lang="scss">
	
	.session{
		display: flex;
		flex-direction: column;
		height: calc(100% - 100upx);
		width: 100%;
		.session_list {
			// flex: 1;
			// background-color: red;
			height: 100%;
			&::-webkit-scrollbar{
				display: none;
			}
			
		}
		
	}

</style>
